{layout name="public/layout" /}
{include file='yxnavbar'}

<div class="main">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#lt_list" aria-controls="lt_list" role="tab" data-toggle="pill">奖项列表</a></li>
        <li><a href="#lt_add" aria-controls="lt_add" role="tab" data-toggle="pill">新增奖项</a></li>
        <li><a href="#lt_edit" aria-controls="lt_edit" role="tab" data-toggle="pill">奖项修改</a></li>
    </ul>
    <div class="tab-content">
        <div class="tab-pane active" id="lt_list">
            <!--  列表框  -->
            <div class="panel panel-default">
                <div class="panel-body table-responsive">
                    <table class="table table-hover">
                        <thead class="navbar-inner">
                        <tr>
                            <th style="width: 50px">序号</th>
                            <th style="width: 150px">奖项名称</th>
                            <th style="width: 100px">奖项数量</th>
                            <th style="width: 80px">奖项万分比</th>
                            <th style="width: 80px">奖项别名</th>
                            <th style="width: 80px">奖品名称</th>
                            <th style="width: 120px">奖品首图</th>
                            <th style="width: 120px">奖品详情</th>
                            <th style="width: 120px">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {loop $list $item}
                        <tr>
                            <td>{$item['cp_id']}</td>
                            <td>{$item['reg_name']}</td>
                            <td>{$item['reg_phone']}</td>
                            <td>
                                <a href="{$item['raw_img_url']}"  target="_blank" title="查看原图"><img src="{$item['first_img_url']}" style="width: 40px;height: 40px;padding: 1px;"></a>
                            </td>
                            <td>{if $item['albums_level']==1}第三方网盘{elseif $item['albums_level']==2}底片云{else}{/if}</td>
                            <td>{$item['download_nums']}</td>
                            <td>{$item['created_at']}</td>
                            <td>
                                {if $item['albums_level']==2}
                                {if $item['ex_status']==1}
                                <span class="label label-success">正常</span>
                                {elseif $item['ex_status']==2}
                                <span class="label label-warning">{$item['diff_days']}天后过期，及时延期</span>
                                {elseif $item['ex_status']==3}
                                <span class="label label-default">已过期</span>
                                {elseif $item['ex_status']==4}
                                <span class="label label-danger">空间已释放</span>
                                {elseif $item['ex_status']==5}
                                <span class="label label-danger">{$item['diff_days']}天后释放空间</span>
                                {else}
                                {/if}
                                {/if}
                                {if $item['albums_level']==1}
                                <span class="label label-success">正常</span>
                                {/if}
                            </td>
                            <td>{$item['note']}</td>
                            <td>
                                {if $item['ex_status']!=4 && $item['ex_status']!=5}
                                {if $item['albums_level']==2}
                                <a href="{php echo createWebUrl('Images', array('op' => 'detail','album_id'=>$item['cp_id']));}"
                                   class="btn btn-warning btn-sm" title="查看全部照片" data-toggle="tooltip" data-placement="top"><i class="fa fa-list"> </i></a>
                                {/if}
                                {if $item['albums_level']==1}
                                <a class="btn btn-warning btn-sm" title="赋值外链密码" onclick="copyOtherUrl(this)" data-url="{$item['other_url']}" data-pwd="{$item['other_url_pwd']}" data-toggle="tooltip" data-placement="top"><i class="fa fa-list"> </i></a>
                                {/if}
                                {if $item["ex_status"]==2}
                                <a class="btn btn-default btn-sm" style="width: 35px" onclick="openDeferAlbum(this)" data-id="{$item['cp_id']}" title="开启相册延期" data-toggle="tooltip" data-placement="top"><i class="fa fa-heart"> </i></a>
                                {/if}
                                {if $item["ex_status"]!=3 && $item["ex_status"]!=2}
                                <a class="btn btn-primary btn-sm" style="width: 35px" onclick="changeAlbumInfo(this)" data-type="reg_name" data-id="{$item['cp_id']}" data-info="{$item['reg_name']}" title="修改相册名称" data-toggle="tooltip" data-placement="top"><i class="fa fa-pencil-square-o"> </i></a>
                                <a class="btn btn-primary btn-sm" style="width: 35px" onclick="changeAlbumInfo(this)" data-type="reg_phone" data-id="{$item['cp_id']}" data-info="{$item['reg_phone']}" title="修改相册绑定手机号" data-toggle="tooltip" data-placement="top"><i class="fa fa-pencil-square-o"> </i></a>
                                {/if}
                                <a class="btn btn-danger btn-sm" style="width: 35px" onclick="deleteAlbum(this)" data-id="{$item['cp_id']}" title="删除相册" data-toggle="tooltip" data-placement="top"><i class="fa fa-times"> </i></a>
                                {/if}
                            </td>
                        </tr>
                        {/loop}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    function drop_confirm(msg, url){
        if(confirm(msg)){
            window.location = url;
        }
    }
</script>
